<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><{$site_title}>管理中心</title>
<{include file="js.html"}>
<script type="text/javascript" src="js/jquery.qqFace.js"></script> 
<script type="text/javascript">
$(function(){
 //回复窗口JS
  $(".hf").click(function(){
    var sort=$(this).attr("sort");  //排序
     $(".reply").hide();
     $(".reply"+sort).show();
   
  })

   //提交
   $(".tj").click(function(){
     var sort=$(this).attr("sort");
     var comment=$(".reply_comment"+sort).val();
     if(comment=='' || comment==null){
        alert("回复不能为空哦");
        return false;
     }
   })


   //删除回复
   $(".del").click(function(){
    var del_id=$(this).attr("del");
    $(this).parent('td').parent('tr').remove();
    $.post(
        'admin_topic_comment.php?action=del',
        {del_id:del_id},
        function(data){
          if(data==1){// alert('删除成功')
          }
      },"json")
   })

  // $("#myForm").submit(function(){
  //   return queding('是否保存设置？',".subCheck");
  // })


  /***评论****/
  //匹配表情-初始化
  $('.neirong').each(function(){
      var text=$(this).html();
      $(this).html(replace_em(text));
  })

  //表情特效
  for (var i = 0; i < '<{$commentNum}>'; i++) {
      $('.emotion'+i).qqFace({ // 
        id : 'facebox'+i, //表情盒子的ID
        assign:'saytext'+i, //给那个控件赋值
        path:'../images/face/' //表情存放的路径，注意如果修改了这个地方，下面正则匹配的地方也要做相应的修改
      });
  };
  /***评论****/
})

 /*//表情替换
    function replace_em(str){
        str = str.replace(/\</g,'&lt;');
        str = str.replace(/\>/g,'&gt;');
        str = str.replace(/\n/g,'<br/>');
        str = str.replace(/\[em_([0-9]*)\]/g,'<img src="../images/face/$1.gif" border="0" />');
        return str;
    }*/
</script>
</head>

<body>
<div class="box">
<div style="background:url(images/mainbj.jpg) repeat-x; line-height:31px; height:31px;">
<table width="262" height="31" border="0" cellpadding="0" cellspacing="0">
<tr><td width="41" align="center">
<img src="images/biao1.jpg" /></td>
<td width="221"><strong>当前位置</strong>：话题管理 &gt; 添加小编说</td>
</tr></table>
</div>

<{if $id!=''}>
<table class="lefttab" cellpadding="0" cellspacing="0">
<tbody>
<tr><td height="50px" class="xiugai">
<a style="float:left; margin-left:5px;" href="admin_topic_add.php?id=<{$id}>"><div class="inp2">基本信息</div></a>
<a style="float:left; margin-left:5px;" href="admin_topic_comment.php?id=<{$id}>"><div class="inp2 inp">查看评论</div></a>
&nbsp;</td>
  </tr>
</tbody></table>
<{/if}>


<table width="849" cellpadding="0" cellspacing="0" class="lefttab">
<tr><td colspan="4"><div style="height:26px; text-align:left; line-height:26px; background:url(images/xbj1.jpg) repeat-x; border:1px solid #e9f5fa;font-weight:bold;">&nbsp;&nbsp;评论详情&nbsp;&nbsp;</div>
</td></tr>
<{foreach item=loop key=key from=$comment}>
<tr>
  <td align="right" width="150px;"><font color="#e47c02"></font> <strong>
  <{$loop.userName}>&nbsp;<{if $loop.reply_id>0}>回复&nbsp;@<{$loop.replyName}><{/if}>
  </strong>：</td>
  <td width="310" align="left">&nbsp;<span class="neirong"><{$loop.comment}></span>&nbsp;&nbsp;<!-- <{$loop.create_time}> -->
  <td align="left" width="100">&nbsp;<{$loop.create_time}></td>
  <td align="left" width="50"><a href="javascript:;" class="hf" sort="<{$key}>">回复|</a><a>
  <a href="javascript:;" class="del" del="<{$loop.id}>">删除</a></td>
</tr>

<form action="" method="post" name="myForm" > 
<tr style="display:none;" class="reply reply<{$key}>">
  <td align="right"><font color="#e47c02"></font> <strong>小编回复</strong>：</td>
  <td width="310" align="left">&nbsp;
  <a href="javascript:;" class="emotion<{$key}>">表情</a>
  <textarea name="reply_comment" class="reply_comment<{$key}>" rows="5" cols="40" id="saytext<{$key}>"></textarea>
  <input type="submit" name="submit" class="tj" value="提交" sort="<{$key}>"/></td>
</tr>
<input type="hidden" name="reply_id" value="<{$loop.id}>" /> 
</form>

<{/foreach}>

</table>



</div>
</body>
</html>